package cn.bdqn.pn.service.schedule.impl;

import cn.bdqn.pn.pojo.schedule.Ticketfile;
import cn.bdqn.pn.reposity.schedule.TicketFileDao;
import cn.bdqn.pn.service.schedule.TicketFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.SQLException;
import java.util.List;

@Service("ticketFileService")
public class TicketFileServiceImpl implements TicketFileService {

    @Autowired
    private TicketFileDao ticketFileDao;

    /**
     * 增加票档
     * @param ticketfile
     * @return
     * @throws SQLException
     */
    @Override
    public boolean addTicketFile(Ticketfile ticketfile) throws SQLException {
        Ticketfile ticketfile1=ticketFileDao.save(ticketfile);
        if(ticketfile!=null){
            return true;
        }else{
            return false;
        }
    }

    @Override
    public List<Ticketfile> selectAllByPlaceid(Integer placeid) throws SQLException {
        return ticketFileDao.findAllByPlaceid(placeid);

    }
}
